import { http } from '@/utils'

export const GET_USER = 'user/getUserInfo'


export const getUserInfo = () => {
  return async (dispatch, getState) => {
    // const res = await http.get('/user/profile', {
    //   headers: {
    //     Authorization: `Bearer ${getState().login}`
    //   }
    // })
    const res = await http.get('/user/profile')
    dispatch({ type: GET_USER, payload: res.data })
  }
}